~ chicken-core (chicken-5) /manual/Module (chicken platform)
Trap1[[tags: manual]]
2[[toc:]]
3
4== Module (chicken platform)
5
6This module provides procedures for obtaining information about the
7platform on which the program is currently running.
8
9=== Build information
10
11These procedures return information about options that can be
12specified at build time.
13
14==== build-platform
15
16<procedure>(build-platform)</procedure>
17
18Returns a symbol specifying the toolset which has been used for
19building the executing system, which is one of the following:
20
21 cygwin
22 mingw32
23 gnu
24 intel
25 clang
26 sun
27 unknown
28
29==== chicken-version
30
31<procedure>(chicken-version [FULL])</procedure>
32
33Returns a string containing the version number of the CHICKEN runtime
34system. If the optional argument {{FULL}} is given and true, then
35a full version string is returned.
36
37==== include-path
38
39<procedure>(include-path)</procedure>
40
41Returns a list of strings representing directory names where included files are located,
42which defaults to the value of the environment variable
43{{CHICKEN_INCLUDE_PATH}}, split on {{:}} (or {{;}} on Windows).
44If the variable is not set, the list is initialized to contain the installation directory
45(usually {{/usr/local/share/chicken}} on UNIX-like systems).
46
47==== repository-path
48
49<parameter>repository-path</parameter>
50
51Contains a list of strings naming the paths to the extension
52repository, which defaults to the value of the environment variable
53{{CHICKEN_REPOSITORY_PATH}}, split on {{:}} (or {{;}} on Windows). If
54the environment variable is not set, it will be a list containing the
55default library path (usually {{/usr/local/lib/chicken}} on UNIX
56systems).
57
58==== installation-repository
59
60<parameter>installation-repository</parameter>
61
62Contains the name of the directory where extensions are installed
63(as opposed to the possible locations where they can be loaded or
64linked at runtime.)
65
66
67=== system-config-directory
68
69<procedure>(system-config-directory)</procedure>
70
71Returns the location of the directory for configuration files. This
72obeys the XDG specification, so when the {{XDG_CONFIG_HOME}}
73environment variable is set, its value is used. When it's not set, it
74will default to {{$HOME/.config}} on UNIX and {{$APPDATA}} on Windows.
75
76
77=== system-cache-directory
78
79<procedure>(system-cache-directory)</procedure>
80
81Returns the location of the directory for caches. This obeys the XDG
82specification, so when the {{XDG_CACHE_HOME}} environment variable is
83set, its value is used. When it's not set, it will default to
84{{$HOME/.cache}} on UNIX and {{$LOCALAPPDATA}} or {{$APPDATA}} on
85Windows.
86
87
88=== Machine information
89
90These procedures return information about the type of CPU/architecture
91the program is running on.
92
93==== machine-byte-order
94
95<procedure>(machine-byte-order)</procedure>
96
97Returns the symbol {{little-endian}} or {{big-endian}}, depending on the
98machine's byte-order.
99
100
101==== machine-type
102
103<procedure>(machine-type)</procedure>
104
105Returns a symbol specifying the processor on which this process is
106currently running, which is one of the following:
107
108 arm
109 alpha
110 mips
111 hppa
112 ultrasparc
113 sparc
114 ppc
115 ppc64
116 ia64
117 x86
118 x86-64
119 unknown
120
121=== Software information
122
123These procedures return information about the type of operating system
124the program is running on.
125
126==== software-type
127
128<procedure>(software-type)</procedure>
129
130Returns a symbol specifying the operating system on which this process
131is currently running, which is one of the following:
132
133 android
134 windows
135 unix
136 ecos
137 unknown
138
139
140==== software-version
141
142<procedure>(software-version)</procedure>
143
144Returns a symbol specifying the operating system version on which this
145process is currently running, which is one of the following:
146
147 linux
148 freebsd
149 netbsd
150 openbsd
151 macosx
152 hpux
153 dragonfly
154 haiku
155 solaris
156 sunos
157 aix
158 hurd
159 unknown
160
161
162=== Feature identifiers
163
164
165CHICKEN maintains a global list of ''features'' naming functionality available
166in the current system. Additionally the {{cond-expand}} form accesses this
167feature list to infer what features are provided. Predefined features are
168{{chicken}}, and the SRFIs (Scheme Request For Implementation) provided by the
169base system: {{srfi-23, srfi-30, srfi-39}}. If the {{eval}} unit
170is used (the default), the features {{srfi-0, srfi-2, srfi-6, srfi-8, srfi-9}}
171and {{srfi-10}} are defined. When compiling code (during compile-time) the
172feature {{compiling}} is registered. When evaluating code in the interpreter
173(csi), the feature {{csi}} is registered.
174
175
176==== features
177
178<procedure>(features)</procedure>
179
180Returns a list of all registered features that will be accepted as valid
181feature-identifiers by {{cond-expand}}.
182
183
184==== feature?
185
186<procedure>(feature? ID ...)</procedure>
187
188Returns {{#t}} if all features with the given feature-identifiers {{ID ...}}
189are registered.
190
191
192==== register-feature!
193
194<procedure>(register-feature! FEATURE ...)</procedure>
195
196Register one or more features that will be accepted as valid
197feature-identifiers by {{cond-expand}}. {{FEATURE ...}} may
198be a keyword, string or symbol.
199
200
201==== unregister-feature!
202
203<procedure>(unregister-feature! FEATURE ...)</procedure>
204
205Unregisters the specified feature-identifiers. {{FEATURE ...}}
206may be a keyword, string or symbol.
207
208
209=== Returning to the host program
210
211=== return-to-host
212
213<procedure>(return-to-host)</procedure>
214
215Exits the Scheme code and returns to the invoking context that called
216{{CHICKEN_run}} or {{CHICKEN_continue}}.
217
218After {{return-to-host}} has been executed and once {{CHICKEN_run}}
219returns, you can invoke callbacks which have been defined with
220{{define-external}}.
221
222
223---
224Previous: [[Module (chicken pathname)]]
225
226Next: [[Module (chicken plist)]]